package io.dcloud.uniplugin;
import io.dcloud.feature.uniapp.UniAppHookProxy;
import  io.dcloud.feature.uniapp.UniSDKEngine;

import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.app.Application;
import android.webkit.WebView;

//import androidx.appcompat.app.AppCompatActivity;

import com.taobao.weex.common.WXException;

public class WebView_AppProxy extends AppCompatActivity implements UniAppHookProxy {
    @Override
    public void onCreate(Application application) {

        //当前uni应用进程回调 仅触发一次 多进程不会触发
        //可通过UniSDKEngine注册UniModule或者UniComponent
        Window window = getWindow();
        //隐藏标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏状态栏
        //定义全屏参数
        int flag=WindowManager.LayoutParams.FLAG_FULLSCREEN;
        //设置当前窗体为全屏显示
        window.setFlags(flag, flag);
        Log.d("webView","webViewApplication");

//        setContentView(TestWebView.webView);

//        try {
//            UniSDKEngine.registerUniComponent("myWebView", TestWebView.class);
//        } catch (WXException e) {
//
//            e.printStackTrace();
//        }
    }

    @Override
    public void onSubProcessCreate(Application application) {
        //其他子进程初始化回调 可用于初始化需要子进程初始化需要的逻辑
        Window window = getWindow();
        //隐藏标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏状态栏
        //定义全屏参数
        int flag=WindowManager.LayoutParams.FLAG_FULLSCREEN;
        //设置当前窗体为全屏显示
        window.setFlags(flag, flag);
//        setContentView(TestWebView.webView);
        Log.d("webView","webViewApplication");
    }
}